<template>
  <BasicDrawer v-bind="$attrs" @register="registerDrawer" destroyOnClose title="打赏记录列表" :width="drawerWidth" :showFooter="false">
    <OrderRewardIndex ref="orderRewardIndex"></OrderRewardIndex>
  </BasicDrawer>
</template>
<script lang="ts" setup>
import { getCurrentInstance, ref, unref } from 'vue';
import { BasicDrawer, useDrawerInner } from '@apps/antd-admin/src/components/drawer';
import OrderRewardIndex from '@apps/ant-bus/src/views/business/butlerserviceManage/orderReward/index.vue';
import { useAppInject } from '@apps/antd-admin/src/hooks/web/use-app-inject';

const { getIsMobile } = useAppInject();
const drawerWidth = ref('60%');
if (unref(getIsMobile)) {
  drawerWidth.value = '80%';
}
const ctx: any = getCurrentInstance();

const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async data => {
  let record = data.record;
  let butlerServiceOrderId = record.butlerServiceOrderId;
  ctx.refs['orderRewardIndex'].setSearchInfoProps(butlerServiceOrderId);
});
</script>
